<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .flex-container {
            display: flex;
            flex-flow: row nowrap;
            /* 设置主轴为水平且不换行 */
            width: 400px;
            height: 100px;
            margin-bottom: 10px;
            padding: 0;
            list-style: none;
            border: 1px solid #000;
        }

        .flex-item {
            flex: 0 0 50px;
            /* 固定宽度为 50px */
            height: 80%;
            margin: 5px;
            background-color: #999;
            color: #fff;
            text-align: center;
            line-height: 100px;
            border: 1px solid #666;
        }

        /* flex-start */
        .flex-container-start {
            justify-content: flex-start;
        }

        /* flex-end */
        .flex-container-end {
            justify-content: flex-end;
        }

        /* center */
        .flex-container-center {
            justify-content: center;
        }

        /* space-between */
        .flex-container-between {
            justify-content: space-between;
        }

        /* space-around */
        .flex-container-around {
            justify-content: space-around;
        }
    </style>
</head>

<body>
    <p>justify-content属性定义了项目在主轴上的对齐方式。</p>
    <p>justify-content: flex-start | flex-end | center | space-between | space-around;</p>


    <ul class="flex-container flex-container-start">
        <li class="flex-item">1</li>
        <li class="flex-item">2</li>
        <li class="flex-item">3</li>
    </ul>

    <ul class="flex-container flex-container-end">
        <li class="flex-item">1</li>
        <li class="flex-item">2</li>
        <li class="flex-item">3</li>
    </ul>

    <ul class="flex-container flex-container-center">
        <li class="flex-item">1</li>
        <li class="flex-item">2</li>
        <li class="flex-item">3</li>
    </ul>

    <ul class="flex-container flex-container-between">
        <li class="flex-item">1</li>
        <li class="flex-item">2</li>
        <li class="flex-item">3</li>
    </ul>

    <ul class="flex-container flex-container-around">
        <li class="flex-item">1</li>
        <li class="flex-item">2</li>
        <li class="flex-item">3</li>
    </ul>

</body>

</html>